package com.lagou.service.impl;

import com.lagou.dao.AccountDao;
import com.lagou.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author Roger
 * @date 2020/8/15 8:12
 * @description
 */
@Service
public class AccountServicecImpl implements AccountService {
    @Autowired
    private AccountDao accountDao;

    @Override
    public void transfer(String to, String from, Double money) {

//            transactionManager.startTransaction();
            accountDao.transferFrom(from, money);
            int i = 1/0;
            accountDao.transferTo(to, money);
//            transactionManager.commit();

    }
}
